﻿<%@ Page Title="" Language="C#" AutoEventWireup="true"
    CodeFile="BranchList.aspx.cs" Inherits="MastData_BranchList" %>

<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.2.Export, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.v9.2" Namespace="DevExpress.Web.ASPxPager"
    TagPrefix="dxwp" %>
<%@ Register Assembly="DevExpress.Web.v9.2" Namespace="DevExpress.Web.ASPxTabControl"
    TagPrefix="dxtc" %>
<%@ Register Assembly="DevExpress.Web.v9.2" Namespace="DevExpress.Web.ASPxClasses"
    TagPrefix="dxw" %>
<%@ Register Assembly="DevExpress.Web.v9.2" Namespace="DevExpress.Web.ASPxPopupControl"
    TagPrefix="dxpc" %>
<%@ Register Assembly="DevExpress.Web.v9.2" Namespace="DevExpress.Web.ASPxRoundPanel"
    TagPrefix="dxrp" %>
<%@ Register Assembly="DevExpress.Web.v9.2" Namespace="DevExpress.Web.ASPxPanel"
    TagPrefix="dxp" %>
<%@ Register TagPrefix="wilson" Namespace="Wilson.ORMapper.Web" Assembly="WilsonORMDataSource" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Branch</title>
    <link href="/Style/StyleSheet.css"  rel="stylesheet" type="text/css"/>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <wilson:DataSource ID="dsBranch" runat="server" ObjectSpace="Touchmax.Manager.ORManager"
            TypeName="Touchmax.XXBranch" KeyMember="CustId" FilterExpression="1=0" />
        <table>
            <tr>
                <td>
                    <dxe:ASPxLabel ID="ASPxLabel1" runat="server" Text="Name" />
                </td>
                <td>
                    <dxe:ASPxTextBox ID="txt_Name" Width="170" runat="server">
                    </dxe:ASPxTextBox>
                </td>
                <td>
                    <dxe:ASPxButton ID="btn_Sch" runat="server" Text="Retrieve" OnClick="btn_Sch_Click">
                    </dxe:ASPxButton>
                </td>
                <td>
                
                    <dxe:ASPxButton ID="ASPxButton1" Width="100" runat="server" Text="Add New" AutoPostBack="false">
                        <ClientSideEvents Click="function(s,e){
                                grid.AddNewRow();
                                }" />
                    </dxe:ASPxButton></td>
            </tr>
        </table>
        <dxwgv:ASPxGridView ID="ASPxGridView1" ClientInstanceName="grid" runat="server" DataSourceID="dsBranch"
            Width="100%" KeyFieldName="CustId" AutoGenerateColumns="False" OnInit="ASPxGridView1_Init"
            OnInitNewRow="ASPxGridView1_InitNewRow" OnRowInserting="ASPxGridView1_RowInserting"
            OnRowInserted="ASPxGridView1_RowInserted" OnRowUpdating="ASPxGridView1_RowUpdating"
            OnRowDeleting="ASPxGridView1_RowDeleting">
            <SettingsPager PageSize="15">
            </SettingsPager>
            <SettingsEditing Mode="EditForm" />
            <Settings ShowFilterRow="false" />
            <SettingsCustomizationWindow Enabled="True" />
            <SettingsBehavior ConfirmDelete="True" />
            <Columns>
                <dxwgv:GridViewDataTextColumn Caption="#" VisibleIndex="0" Width="5%">
                    <DataItemTemplate>
                        <a onclick='parent.PutValue("<%# Eval("CustId") %>","<%# Eval("Code") %>");'>Select</a>
                    </DataItemTemplate>
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewCommandColumn Width="100">
                    <EditButton Visible="True" />
                    <DeleteButton Visible="true" />
                </dxwgv:GridViewCommandColumn>
                <dxwgv:GridViewDataTextColumn Caption="Id" FieldName="CustId" VisibleIndex="1" Width="100">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn Caption="Code" FieldName="Code" VisibleIndex="2">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn Caption="Name" FieldName="Name" VisibleIndex="2">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn Caption="Tel" FieldName="Tel1" VisibleIndex="3">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn Caption="Fax" FieldName="Fax1" VisibleIndex="4">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn Caption="Email" FieldName="Email1" VisibleIndex="5">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn Caption="Contact" FieldName="Contact1" VisibleIndex="6">
                </dxwgv:GridViewDataTextColumn>
            </Columns>
            <Templates>
                <EditForm>
                    <div style="padding: 4px 4px 3px 4px">
                        <table width="70%">
                            <tr>
                                <td>
                                    Branch Id
                                </td>
                                <td>
                                    <dxe:ASPxTextBox ID="ASPxTextBox6" Enabled="false" runat="server" Width="100" Value='<%# Bind("CustId") %>'>
                                    </dxe:ASPxTextBox>
                                </td>
                                <td>
                                    Short Name
                                </td>
                                <td>
                                    <dxe:ASPxTextBox ID="ASPxTextBox23" runat="server" Width="100%" Value='<%# Bind("Code") %>'>
                                    </dxe:ASPxTextBox>
                                </td>
                            <tr></tr>
                                <td>
                                    Full Name
                                </td>
                                <td colspan="3">
                                    <dxe:ASPxTextBox ID="ASPxTextBox1" runat="server" Width="100%" Value='<%# Bind("Name") %>'>
                                    </dxe:ASPxTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Address
                                </td>
                                <td colspan="3">
                                    <dxe:ASPxMemo ID="ASPxTextBox3" Rows="3" runat="server" Width="100%" Value='<%# Bind("Address") %>'>
                                    </dxe:ASPxMemo>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Telephone
                                </td>
                                <td>
                                    <dxe:ASPxTextBox ID="ASPxTextBox8" runat="server" Width="100%" Value='<%# Bind("Tel1") %>'>
                                    </dxe:ASPxTextBox>
                                </td>
                                <td>
                                    Fax
                                </td>
                                <td>
                                    <dxe:ASPxTextBox ID="ASPxTextBox9" runat="server" Width="100%" Value='<%# Bind("Fax1") %>'>
                                    </dxe:ASPxTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td>
                                    <dxe:ASPxTextBox ID="ASPxTextBox12" runat="server" Width="100%" Value='<%# Bind("Tel2") %>'>
                                    </dxe:ASPxTextBox>
                                </td>
                                <td>
                                </td>
                                <td>
                                    <dxe:ASPxTextBox ID="ASPxTextBox13" runat="server" Width="100%" Value='<%# Bind("Fax2") %>'>
                                    </dxe:ASPxTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Contact
                                </td>
                                <td>
                                    <dxe:ASPxTextBox ID="ASPxTextBox10" runat="server" Width="100%" Value='<%# Bind("Contact1") %>'>
                                    </dxe:ASPxTextBox>
                                </td>
                                <td>
                                    Email
                                </td>
                                <td>
                                    <dxe:ASPxTextBox ID="ASPxTextBox11" runat="server" Width="100%" Value='<%# Bind("Email1") %>'>
                                    </dxe:ASPxTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td>
                                    <dxe:ASPxTextBox ID="ASPxTextBox14" runat="server" Width="100%" Value='<%# Bind("Contact2") %>'>
                                    </dxe:ASPxTextBox>
                                </td>
                                <td>
                                </td>
                                <td>
                                    <dxe:ASPxTextBox ID="ASPxTextBox15" runat="server" Width="100%" Value='<%# Bind("Email2") %>'>
                                    </dxe:ASPxTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Remarks
                                </td>
                                <td colspan="3">
                                    <dxe:ASPxTextBox ID="ASPxTextBox18" runat="server" Width="100%" Value='<%# Bind("Remark") %>'>
                                    </dxe:ASPxTextBox>
                            </tr>
                            <tr>
                                <td>
                                    UEI No
                                </td>
                                <td colspan="3">
                                    <dxe:ASPxTextBox ID="txt_UeiNo" runat="server" Text='<%# Bind("UeiNo") %>'>
                                    </dxe:ASPxTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    User Id
                                </td>
                                <td>
                                    <%# Eval("UserId") %>
                                </td>
                                <td>
                                    Entry D
                                </td>
                                <td>
                                    <%# Eval("EntryDate","{0:dd/MM/yyyy}") %>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4" style="text-align: right; padding: 2px 2px 2px 2px">
                                    <dxwgv:ASPxGridViewTemplateReplacement ID="ASPxGridViewTemplateReplacement1" ReplacementType="EditFormUpdateButton"
                                        runat="server">
                                    </dxwgv:ASPxGridViewTemplateReplacement>
                                    <dxwgv:ASPxGridViewTemplateReplacement ID="ASPxGridViewTemplateReplacement2" ReplacementType="EditFormCancelButton"
                                        runat="server">
                                    </dxwgv:ASPxGridViewTemplateReplacement>
                                </td>
                            </tr>
                        </table>
                    </div>
                </EditForm>
            </Templates>
        </dxwgv:ASPxGridView>
        <dxwgv:ASPxGridViewExporter ID="gridExport" runat="server" GridViewID="ASPxGridView1">
        </dxwgv:ASPxGridViewExporter>
         
                <dxpc:ASPxPopupControl id="popubCtr" runat="server" CloseAction="CloseButton" Modal="True"
            PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" ClientInstanceName="popubCtr"
            HeaderText="Customer" AllowDragging="True" EnableAnimation="False" height="500"
            AllowResize="True" width="920" EnableViewState="False">
                    <ContentCollection>
<dxpc:PopupControlContentControl runat="server"></dxpc:PopupControlContentControl>
</ContentCollection>
        </dxpc:ASPxPopupControl>
        <dxpc:ASPxPopupControl id="popubCtr1" runat="server" CloseAction="CloseButton" Modal="True"
            PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" ClientInstanceName="popubCtr1"
            HeaderText="Customer" AllowDragging="True" EnableAnimation="False" height="500"
            AllowResize="True" width="920" EnableViewState="False">
            <clientsideevents closeup="function(s, e) {
      if(grid!=null)
	    grid.Refresh();
	    grid=null;
}" />
<ContentCollection>
<dxpc:PopupControlContentControl runat="server"></dxpc:PopupControlContentControl>
</ContentCollection>
        </dxpc:ASPxPopupControl>
        
    </div>
    </form>
</body>
</html>
